<template>
  <ul class='list'>
    <li v-for="item in getListData">
      <div class="box">
        <img :src="item.img" class="fl" alt="">
        <div class="content clear">
          <p class="title white-space">{{item.title}}</p>
          <p class="starttime white-space">开始时间：{{item.starttime}}</p>
          <p class="endtime white-space">结束时间：{{item.endtime}}</p>
        </div>

        <div class="btn">
          <span v-if="selectI!=3" :class="{'color-gold':item.state==1,'btn-active':item.state==1,'disabled':item.state==0}">{{item.state==1?"下架":"已下架"}}</span>
          <span class="color-gold btn-active" @click="showDetail(item)">{{listname}}</span>
        </div>
      </div>
      <GreyLine></GreyLine>
    </li>
  </ul>
</template>
<script>
import GreyLine from '../../common/line.vue'
export default {
  props:["data","listname","selectedIndex"],
  components:{GreyLine},
  name: "",
  data () {
    return {
      urls:[
        "/works/activities/signlist",
        "/works/activities/signlist",
        "/works/activities/prizelist",
        "/works/activities/suggestlist"
      ],
      selectI:0,
    };
  },
  computed:{
    getListData(){
      this.selectI=this.selectedIndex
      return this.data||[]
    }
  },
   methods:{
     showDetail(item){
       sessionStorage.setItem("userId",item.id)

       this.$router.push(this.urls[this.selectI]||"")
     }
  },
   created(){
  }
}
</script>
<style lang="scss" scoped>
.list{

  li{
    >div.box{
      padding:15px;
      
    }
    .content{
      margin-left: 95px;
      height: 60px;

      p{
        font-size: 12px;
        color: #999;
        line-height: 16px;
      }
      p.title{
        line-height: 28px;
        font-size: 14px;
        color: #333;
      }
    }

    img{
      display: inline-block;
      width: 80px;
      height: 60px;
    }

    .btn{
      display: flex;
      margin-top: 15px;
      justify-content: space-around;

      span{
        width: 80%;
        text-align: center;
        height: 40px;
        line-height: 40px;
        box-sizing: border-box;
        border: 1px solid #F3AC00;
        border-radius: 5px;
        font-size: 16px;
      }
      span:nth-child(1){
        margin-right: 5%;
      }
      .disabled{
        border: 1px solid #969696;
        color: #969696;
      }
    }
  }
}
</style>